// Package study
/**
* @Project : geektime-basic-go-study
* @File    : test.go
* @IDE     : GoLand
* @Author  : Tvux
* @Date    : 2024/9/11 20:43
**/

package main

import (
	"crypto/rand"
	"encoding/hex"
	"fmt"
)

func main() {
	// 生成身份验证密钥（64字节）
	authKey := make([]byte, 64)
	_, err := rand.Read(authKey)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Authentication Key: %s\n", hex.EncodeToString(authKey))
	// 0032c42925316af8f2199dcfaccae67a16189bf29f366697df1fa84f15ae19231b0e7babdbf613a8be0ee0a9820d76ef439083e47c95203089d1912c10eeb92a

	// 生成加密密钥（32字节，用于AES-256）
	encKey := make([]byte, 32)
	_, err = rand.Read(encKey)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Encryption Key: %s\n", hex.EncodeToString(encKey))
	// d41bdea1a7074245d93baa8f5741d0911cd01faa7ea8549fbbe50408c573ddc2
}
